import axios from '@/libs/api.request'
import qs from "qs";
// 项目点接口
export const getOrgs = (params) => {
  return axios.request({
      url: '/content/org',
      method: 'get',
      params: params
  })
}

export const addOrg = (params) => {
  return axios.request({
      url: '/content/org',
      method: 'post',
      data:qs.stringify(params)
  })
}

export const getOrgById = (orgId) => {
  return axios.request({
      url:`/content/org/${orgId}`,
      method:"get",
  })
}

export const editOrg = (orgId,params) => {
  return axios.request({
      url:`/content/org/${orgId}`,
      method: "post",
      data:qs.stringify(params)
  })
}

export const delOrg = (orgId) => {
  return axios.request({
      url:`/content/org/${orgId}`,
      method:"delete",
  })
}

// 获取当前用户关联的机构
export const getUserOrg = ()=>{
  return axios.request({
      url:`/user/org`,
      method:'get',
  })
}
